<?php if ($this->method == 'create'): ?>
<h3><?php echo lang('groupon_create_title'); ?></h3>
<?php else: ?>
<h3><?php echo sprintf(lang('groupon_edit_title'), $deal->title); ?></h3>
<?php endif; ?>

<?php echo form_open(uri_string(), 'class="crud"'); ?>

<!-- Content tab -->
<div id="blog-content-tab" class="box">
    <ol style="width: 65%; padding: 3px; float: left;">
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="title"><?php echo lang('groupon_product_title_label'); ?></label>
            <?php echo form_input('title', htmlspecialchars_decode($deal->title), 'maxlength="250"'); ?>
            <span class="required-icon tooltip"><?php echo lang('required_label'); ?></span>

            <p class="text-small" style="display: inline;"><?php echo lang('groupon_product_title_desc');?></p>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="short_title"><?php echo lang('groupon_product_short_title_label'); ?></label>
            <?php echo form_input('short_title', htmlspecialchars_decode($deal->short_title), 'maxlength="100"'); ?>
            <span class="required-icon tooltip"><?php echo lang('required_label'); ?></span>

            <p class="text-small" style="display: inline;"><?php echo lang('groupon_product_short_title_desc');?></p>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="slug"><?php echo lang('groupon_slug_label'); ?></label>
            <?php echo form_input('slug', $deal->slug, 'maxlength="100" class="width-20"'); ?>
            <span class="required-icon tooltip"><?php echo lang('required_label'); ?></span>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="star"><?php echo lang('rate_label'); ?></label>
            <?php echo form_dropdown('start', array(0 => lang('select_star_label'), 1 => lang('one_star_label'), 2 => lang('two_star_label'), 3 => lang('three_star_label'), 4 => lang('four_star_label'), 5 => lang('five_star_label')), $deal->star) ?>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="status_id"><?php echo lang('groupon_status_label'); ?></label>
            <?php echo form_dropdown('status_id', array(1 => lang('groupon_hidden_label'), 2 => lang('groupon_open_label'), 3 => lang('groupon_deleted_label'), 4 => lang('groupon_expired_label')), $deal->status_id) ?>
        </li>
        <li class="<?php echo alternator('even', ''); ?> date-meta">
            <label><?php echo lang('groupon_time_label'); ?></label>

            <div style="float:left;">
                <div style="overflow: hidden;">
                    <label><?php echo lang('groupon_start_tips'); ?></label>
                    <?php echo lang('date_label');?>
                    <?php echo form_input('created', format_date($deal->created, 'Y-m-d'), 'maxlength="10" id="datepicker" class="text width-20"'); ?>
                    <?php echo lang('hours_label');?>
                    <?php echo form_dropdown('created_hour', $hours, format_date($deal->created, 'H')) ?>
                    : <?php echo form_dropdown('created_minute', $minutes, format_date($deal->created, 'i')) ?><br/>
                </div>
                <div style="overflow: hidden; padding-top: 10px">
                    <label><?php echo lang('groupon_end_tips'); ?></label>
                    <?php echo lang('date_label');?>
                    <?php echo form_input('created', format_date($deal->created, 'Y-m-d'), 'maxlength="10" id="datepicker" class="text width-20"'); ?>
                    <?php echo lang('hours_label');?>
                    <?php echo form_dropdown('created_hour', $hours, format_date($deal->created, 'H')) ?> :
                    <?php echo form_dropdown('created_minute', $minutes, format_date($deal->created, 'i')) ?>
                </div>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="short_description"><?php echo lang('groupon_intro_label'); ?></label>
            <?php echo form_textarea(array('id' => 'short_description', 'name' => 'short_description', 'value' => $deal->short_description, 'rows' => 5, 'class' => 'wysiwyg-simple')); ?>
        </li>
    </ol>

    <ol class="even">
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="max_limit"><?php echo lang('max_limit_label'); ?></label>

            <div class="text-small1">
                <?php
                            echo form_input('max_limit', $deal->max_limit);
                ?>
                <?php echo lang('max_limit_desc');?>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="min_limit"><?php echo lang('min_limit_label'); ?></label>

            <div class="text-small1">
                <?php
                            echo form_input('min_limit', $deal->min_limit);
                    ?>
                    <?php echo lang('min_limit_desc');?>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="max_per_order"><?php echo lang('max_per_order_label'); ?></label>

            <div class="text-small1">
                <?php
                            echo form_input('max_per_order', $deal->max_per_order);
                    ?>
                    <?php echo lang('max_per_order_desc');?>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="min_per_order"><?php echo lang('min_per_order_label'); ?></label>

            <div class="text-small1">
                <?php
                echo form_input('min_per_order', $deal->min_per_order);
                    ?>
                    <?php echo lang('min_per_order_desc');?>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="thumbnail_id"><?php echo lang('thumbnail_label'); ?></label>

            <div class="text-small1">
                <?php
                            echo form_hidden('thumbnail_id', $deal->thumbnail_id);
                    echo img(array('src' => BASE_URL . 'libs/thumb/' . $deal->thumbnail_id, 'alt' => $deal->thumbnail_id, 'id' => 'thumbnail_preview'));
                    ?>
                    <?php echo lang('change_thumbnail_label');?>
            </div>
        </li>
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="category_id">
                <?php echo lang('groupon_category_label'); ?>
            </label>

            <div class="text-small1">
                <?php echo form_multiselect('category_id', array(lang('groupon_no_category_select_label')) + $categories, @$deal->category_id) ?>
                <?php echo lang('multiselect.desc');?>
            </div>
        </li>
    </ol>
    <ol class="unit" style="padding: 3px;">
        <li class="<?php echo alternator('even', ''); ?>">
            <label for="description"><?php echo lang('groupon_content_label'); ?></label>
            <?php echo form_textarea(array('id' => 'description', 'name' => 'description', 'value' => $deal->description, 'rows' => 50, 'class' => 'wysiwyg-advanced')); ?>
        </li>
    </ol>
</div>
<div class="buttons float-right padding-top">
    <?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'save_exit', 'cancel'))); ?>
</div>

<?php echo form_close(); ?>